<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_弹性布局入门</title>
    <style>
        .container{
            background-color: lightgreen;
            /*给父容器使用弹性布局*/
            display:flex;
            /*主轴方向*/
            flex-direction: row;/*行模式 从左往右排列*/
            flex-direction: column;/*链模式 竖着排列，从上到下 1.2.3..*/
            flex-direction: column-reverse;/*链模式 反转排序 ..3.2.1 */
            flex-direction: row-reverse;/*行模式反转 从右往左排列*/

            width: 500px;
            /*设置子元素是否换行*/
            /*默认当父容器空间不足时，子元素会压缩自己不会换行*/
            flex-wrap: nowrap;/*不换行*/
            flex-wrap: wrap;/*换行*/
        }
        .item{
            width: 100px;
            height: 100px;
            background-color: lightpink;
            border: 1px solid black;
            font-size: 45px;

        }
    </style>
</head>
<body>
<div class="container">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
</div>
</body>
</html>